package customer.zspt.cn.customer.Adapter;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import java.util.List;

import customer.zspt.cn.customer.R;
import customer.zspt.cn.customer.bean.QuiteOrderDao;

/**
 * Created by Administrator on 2018/7/23 0023.
 */

public class QuiteOrderAdapter extends BaseAdapter {
    List<QuiteOrderDao.OrderDao> data;
    Context mContext;
    public QuiteOrderAdapter( List<QuiteOrderDao.OrderDao> data, Context context)
    {
        this.data = data;
        mContext = context;
    }
    @Override
    public int getCount() {
        return data.size();
    }

    @Override
    public Object getItem(int position) {
        return data.get(position);
    }

    @Override
    public long getItemId(int position) {
        return position;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        ViewHolder holder = null;
        if(convertView==null)
        {
            holder = new ViewHolder();
            convertView = View.inflate(mContext, R.layout.quite_vp_ls_item,null);
            holder.title = convertView.findViewById(R.id.title);
            convertView.setTag(holder);
        }
        else{
            holder = (ViewHolder) convertView.getTag();
        }
        holder.title.setText(data.get(position).gdatapropTitle);
        return convertView;
    }

    class ViewHolder{
        TextView title;
    }
}
